package com.yunhe.estatemanage.repository;
import com.yunhe.estatemanage.domain.IncidentSatisfactionTable;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @description 事件满意度表
 * @author misty
 * @date 2021-09-06
 */
@Repository
public interface IncidentSatisfactionTableRepository {

    /**
     * 新增
     * @author misty
     * @date 2021/09/06
     **/
    int createIncidentSatisfactionTable(IncidentSatisfactionTable incidentSatisfactionTable);

    /**
     * 新增
     * @author misty
     * @date 2021/09/06
     **/
    int createIncidentSatisfactionTableSelective(IncidentSatisfactionTable incidentSatisfactionTable);

    /**
     * 刪除
     * @author misty
     * @date 2021/09/06
     **/
    int deleteIncidentSatisfactionTableByPrimaryKey(@Param("id") int id);

    /**
     * 更新
     * @author misty
     * @date 2021/09/06
     **/
    int updateIncidentSatisfactionTableByPrimaryKey(IncidentSatisfactionTable incidentSatisfactionTable);

    /**
     * 更新
     * @author misty
     * @date 2021/09/06
     **/
    int updateIncidentSatisfactionTableByPrimaryKeySelective(IncidentSatisfactionTable incidentSatisfactionTable);

    /**
     * 根据主键查询
     * @author misty
     * @date 2021/09/06
     **/
    IncidentSatisfactionTable searchIncidentSatisfactionTableByPrimaryKey(@Param("id") int id);

    /**
     * @Description 获取满意度平均值
     * @Param List<Long> ids
     * @Return double
     * @Date 2021/9/6 17:22
     */
    double getAvgSatisfactionScore(@Param("ids") List<Long> ids);

    List<IncidentSatisfactionTable> searchIncidentSatisfactionTableByReportForRepairId(@Param("reportForRepairId") Long reportForRepairId);
}